<template>
  <div>
    <el-form ref="form" :model="form" label-width="100px">
      <el-form-item label="放款时间">
        <el-date-picker v-model="form.loanDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="首次扣款时间">
        <el-date-picker v-model="form.beginDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
        </el-date-picker>
      </el-form-item>
    </el-form>
     <span slot="footer" class="dialog-footer">
    <!-- <el-button type="primary" @click="onSubmit">提 交</el-button> -->
        <el-popconfirm
            title="确认核对首次扣款时间,确定提交吗？"
            @onConfirm="onSubmit"
          >
            <el-button
              slot="reference"
              type="primary"
              v-no-more-click
              >提 交</el-button
            >
          </el-popconfirm>
  </span>
  </div>
</template>

<script>
import {postDeductDate} from "@/assets/js/api";
export default {
  name: "electronic",
  props: {
    diaId: {
      type: Number,
    },
  },
  data() {
    return {
      form: {},
    };
  },
  created() {},
  methods: {
      onSubmit() {
          this.form.id = this.diaId;
          postDeductDate(this.form).then(res => {
              if(res.code == 200) {
                  this.$message.success(res.message)
                  this.$emit("loanTimeDia", false);
              } else {
                  this.$message.error(res.message)
              }
          })
      }
  },
};
</script>

<style scoped type="less">
::v-deep .el-form-item__content {
    text-align:left ;
}
</style>
